<template>
  <main-wrap>
    <div class="msgListWrap">
      <div class="weui-form-preview mycard">
        <div class="weui-form-preview__hd">
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">预计花费</label>
            <em class="weui-form-preview__value aright">{{order_detail.expectedCost}}</em>
          </div>
        </div>
        <div class="weui-form-preview__bd">
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label black">维修类型</label>
            <span class="weui-form-preview__value">{{rtypetext}}</span>
          </div>
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label black">维修项目</label>
            <span class="weui-form-preview__value">{{order_detail.repairItemStr}}</span>
          </div>
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label black">设备编号</label>
            <span class="weui-form-preview__value">{{order_detail.deviceNum}}</span>
          </div>
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label black">故障描述</label>
            <span class="weui-form-preview__value">{{order_detail.repairDesc}}</span>
          </div>
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label black">上传图片</label>
            <!-- <span class="weui-form-preview__value">
              <img v-for="(img, index) of imgs" :key="index" :src="img" class="imgItem" @click="showimggallery(index)">
            </span> -->
            <div class="weui-form-preview__value attachwrap">
              <my-attachments :attachments="order_detail.attachments" :attachtype="'1'"></my-attachments>
            </div>
          </div>
        </div>
        <div class="weui-form-preview__ft">
          <router-link :to="'/morderdetail'" class="weui-form-preview__btn weui-form-preview__btn_primary">返回</router-link>
        </div>
      </div>
    </div>

  </main-wrap>
</template>

<script>
import MainWrap from '@/components/mainWrap'
import MyAttachments from '@/components/myattachments'
import { mapState } from 'vuex'
export default {
  name: 'MroReportDetail',
  data () {
    return {
      rtypetext: ''
    }
  },
  components: {
    MainWrap,
    MyAttachments
  },
  computed: {
    ...mapState(['order_detail'])
  },
  mounted () {
    this.rtypetext = this.cm.getCategoryStr(this.order_detail.labelId)
  }
}
</script>

<style lang="stylus" scoped>
.weui-form-preview__item
  margin-top 1em

.weui-form-preview__ft
  margin-top .6rem

.weui-form-preview__bd
  .weui-form-preview__value
    text-align left
    padding-left 1em
    &.attachwrap
      padding-left 0
</style>
